<template>

    <div class="submit">
 
        <van-submit-bar :button-text="total">
            <van-checkbox class="box">
                <input  name="" id="" :checked="isFull" @change="isCheck">
                <span>全选</span>
            </van-checkbox>
            <div class="totalPrice">
                <p>合计:</p>
                ￥<span>{{ sum.toFixed(2) }}</span>
            </div>
            <template #tip>
                你的收货地址不支持同城送, <span>修改地址</span>
            </template>
        </van-submit-bar>
    </div>
</template>

<script>

export default {
    props: {
        isFull: {
            type: Boolean,
        },
        sum: {
            type: Number,
            default: 0
        },
        total: {
            default: 0
        }
    },
    methods: {
        // 全选框改变就把值传给父组件
        isCheck(e) {
            this.$emit("isChecked", e.target.checked)
        }
    }
}
</script>

<style scoped>
.van-submit-bar__bar::v-deep span {
    margin-left: .2rem;
}

.submit {
    height: 1.36rem;
    font-size: .32rem;
}
/* van-icon van-icon-success */
::v-deep .van-checkbox {
position: relative;
top: -0.13rem;
}
::v-deep .van-icon{
    position: relative;
        top: 0.18rem;
}
.box {
    width: 1.68rem;
}

.totalPrice {
    width: 3.3rem;
    display: flex;
    align-items: center;
    justify-content: center;

}

.totalPrice>span {
    font-weight: bold;
    color: #F2270C;
}

.van-submit-bar__button {
    width: 2.26rem;
}
</style>